Relations

The Job Market

People laid off post-Covid are now competing with fresh graduates.

Even 2008 was different, because every sector got affected. Right now, it’s mainly the tech sector.

Internship Advice: Keep trying

Binary Relations

Given a set S, a binary relation on S is a subset of S \times S

x \rho y \leftrightarrow (x,y) \in \rho

The notation x \rho y implies that the ordered pair (x,y) satisfies the relationship \rho.

Suppose S = \{ 1,2,4 \}, the Cartesian product of S with itself is:

Problem: What is the set where \rho on S is defined by x \rho y \leftrightarrow x + y is odd where S = \{1,2\}?

Relations on Multiple Sets

Given two sets S and T, a binary relation from S to T is a subset of S \times T.


For example, suppose— S_1 = \{ 1,2,3 \} \qquad S_2 = \{ 2,3,4 \} \qquad S_3 = \{ 3,4,5 \} \\~\\ \rho: (x,y,z) \leftrightarrow x < y < z

—then the set representation of \rho is: \rho: \{\\ (1,2,3), (2,3,4) , (3,4,5),\\ (1,2,4), (1,2,5), (1,3,4), (1,3,5), (1,4,5),\\ (2,3,5), (2,4,5) \\\}

Types of Relationships

One-to-one: If each first component and each second component only appear once in the relation.

One-to-many:If a first component is paired with more than one second component.

Many-to-one: If a second component is paired with more than one first component.

Many-to-many: If at least one first component is paired with more than one second component and at least one second component is paired with more than one first component.

Examples

Identify the relationships:

  1. \{ (5,2),(7,5),(9,2) \}
  2. \{ (2,5),(5,7),(7,2) \}
  3. \{ (7,9),(2,5),(9,9),(2,7) \}

Properties of Relations

Note: For the examples, suppose S = \{ 1,2,3 \}

Reflexive: (\forall x)[x \in S \to (x,x) \in \rho]

Symmetric: (\forall x)(\forall y)[ x \in S \land y \in S \land (x,y) \in \rho \to (y,x) \in \rho ]

Transitive: (\forall x)(\forall y)(\forall x)[ x \in S \land y \in S \land X \in S \land (x,y) \in P \land (y,z) \in \rho \to (x,z) \in \rho ]

Antisymmetric: (\forall x)(\forall y)[x \in S \land y \in S \land (x,y) \in \rho \land (y,x) \in \rho \to x = y]

Note: Symmetric and antisymmetric aren’t complements. A set can be neither, or both.

Example

Example: Consider the relation \le on the set of natural numbers: \{(0,1),(0,0),(1,1),(0,2),(2,2)\}

Closure of Relations

Closure of a Relation: A binary relation \rho * on set S.

Example: Let S = \{1,2,3\} and \rho = \{(1,1),(1,2),(1,3),(3,1),(2,3)\}

Closures: